package com.teasale.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 
 * @TableName order
 */
@TableName(value ="s_order")
public class Order implements Serializable {

    /**
     * 订单编号
     */
    @TableId(type = IdType.AUTO)
    private Integer orderId;

    /**
     * 创建时间
     */
    private Date orderTime;

    /**
     * 订单发货状态
     */
    private Integer orderStatu;

    /**
     * 订单支付状态
     */
    private Integer orderPay;

    /**
     * 订单总价
     */
    private Double orderPrice;

    /**
     * 用户Id
     */
    private Integer userId;

    public String getOrderOutId() {
        return orderOutId;
    }

    public void setOrderOutId(String orderOutId) {
        this.orderOutId = orderOutId;
    }

    public List<OrderGoods> getOrderGoods() {
        return orderGoods;
    }

    public void setOrderGoods(List<OrderGoods> orderGoods) {
        this.orderGoods = orderGoods;
    }

    /**
     * 订单编号
     */
    private String orderOutId;

    //一对多:订单一对商品
    @TableField(exist = false)
    private List<OrderGoods> orderGoods;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 订单编号
     */
    public Integer getOrderId() {
        return orderId;
    }

    /**
     * 订单编号
     */
    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

    /**
     * 创建时间
     */
    public Date getOrderTime() {
        return orderTime;
    }

    /**
     * 创建时间
     */
    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }

    /**
     * 订单发货状态
     */
    public Integer getOrderStatu() {
        return orderStatu;
    }

    /**
     * 订单发货状态
     */
    public void setOrderStatu(Integer orderStatu) {
        this.orderStatu = orderStatu;
    }

    /**
     * 订单支付状态
     */
    public Integer getOrderPay() {
        return orderPay;
    }

    /**
     * 订单支付状态
     */
    public void setOrderPay(Integer orderPay) {
        this.orderPay = orderPay;
    }

    /**
     * 订单总价
     */
    public Double getOrderPrice() {
        return orderPrice;
    }

    /**
     * 订单总价
     */
    public void setOrderPrice(Double orderPrice) {
        this.orderPrice = orderPrice;
    }

    /**
     * 
     */
    public Integer getUserId() {
        return userId;
    }

    /**
     * 
     */
    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Order other = (Order) that;
        return (this.getOrderId() == null ? other.getOrderId() == null : this.getOrderId().equals(other.getOrderId()))
            && (this.getOrderTime() == null ? other.getOrderTime() == null : this.getOrderTime().equals(other.getOrderTime()))
            && (this.getOrderStatu() == null ? other.getOrderStatu() == null : this.getOrderStatu().equals(other.getOrderStatu()))
            && (this.getOrderPay() == null ? other.getOrderPay() == null : this.getOrderPay().equals(other.getOrderPay()))
            && (this.getOrderPrice() == null ? other.getOrderPrice() == null : this.getOrderPrice().equals(other.getOrderPrice()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOrderId() == null) ? 0 : getOrderId().hashCode());
        result = prime * result + ((getOrderTime() == null) ? 0 : getOrderTime().hashCode());
        result = prime * result + ((getOrderStatu() == null) ? 0 : getOrderStatu().hashCode());
        result = prime * result + ((getOrderPay() == null) ? 0 : getOrderPay().hashCode());
        result = prime * result + ((getOrderPrice() == null) ? 0 : getOrderPrice().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", orderId=").append(orderId);
        sb.append(", orderTime=").append(orderTime);
        sb.append(", orderStatu=").append(orderStatu);
        sb.append(", orderPay=").append(orderPay);
        sb.append(", orderPrice=").append(orderPrice);
        sb.append(", userId=").append(userId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}